home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / xlib03.zip / XLIB.INC < prev    next >
Text File  |  1993-04-05  |  4KB  |  127 lines

  1. ;-----------------------------------------------------------------------
  2. ;
  3. ; XLIB - Include file
  4. ;
  5. ; Global equates and variables
  6. ;
  7. ;
  8. ; ****** XLIB - Mode X graphics library                ****************
  9. ; ******                                               ****************
  10. ; ****** Written By Themie Gouthas                     ****************
  11. ; ****** Aeronautical Research Laboratory              ****************
  12. ; ****** Defence Science and Technology Organisation   ****************
  13. ; ****** Australia                                     ****************
  14. ;
  15. ; egg@dstos3.dsto.gov.au
  16. ; teg@bart.dsto.gov.au
  17. ;
  18. ; MODIFICATIONS:
  19. ;  26-9-92:       Pel panning code added
  20. ;-----------------------------------------------------------------------
  21.  
  22. ;
  23.  
  24. LOCALS
  25. .286
  26.  
  27. ; First lets find out what memory model to use
  28.  
  29. include model.inc
  30.  
  31.  
  32. AC_INDEX        equ  03c0h   ;Attribute controller index register
  33. MISC_OUTPUT     equ  03c2h   ;Miscellaneous Output register
  34. SC_INDEX        equ  03c4h   ;Sequence Controller Index
  35. GC_INDEX        equ  03ceh   ; Graphics controller Index
  36. CRTC_INDEX      equ  03d4h   ;CRT Controller Index
  37. DAC_READ_INDEX    equ  03c7h   ;
  38. DAC_WRITE_INDEX equ  03c8h   ;
  39. DAC_DATA    equ  03c9h   ;
  40. INPUT_STATUS_0 equ   03dah   ;Input status 0 register
  41.  
  42.  
  43. SCREEN_SEG    equ    0a000h  ;segment of display memory in mode X
  44.  
  45. MAP_MASK      equ    02h     ;index in SC of Map Mask register
  46. READ_MAP      equ    04h     ;index in GC of the Read Map register
  47. BIT_MASK      equ    08h     ;index in GC of Bit Mask register
  48.  
  49. OVERFLOW      equ    07h     ; CRTC overflow register index
  50. MAX_SCAN_LINE equ    09h     ; CRTC maximum scan line register index
  51. ADDR_HIGH     equ    0ch     ;Index of Start Address High reg in CRTC
  52. ADDR_LOW      equ    0dh     ;                       Low
  53. CRTC_OFFSET   equ    13h     ; CRTC offset register index
  54. UNDERLINE     equ    14h     ; CRTC underline location register index
  55. MODE_CONTROL  equ    17h     ; CRTC mode control register index
  56. LINE_COMPARE  equ    18h     ; CRTC line compare reg. index (bits 0-7 of
  57.                  ; split screen scan line
  58.  
  59. AC_MODE_CONTROL equ    10h   ; Index of Mode COntrol register in AC
  60. PEL_PANNING     equ    13h   ; Pel panning register index in AC
  61.  
  62. PATTERN_BUFFER equ 0fffch    ;offset in screen memory of pattern buffer
  63.  
  64. TRUE    equ 1
  65. FALSE   equ 0
  66.  
  67.  
  68. OK             equ 0
  69. ERROR          equ 1
  70.  
  71.  
  72. ;-----------------------------------------------------------------------
  73. ; Macro to wait for the vertical retrace leading edge
  74.  
  75. WaitVsyncStart   macro
  76.     mov     dx,INPUT_STATUS_0
  77. @@WaitNotVsync:
  78.     in      al,dx
  79.     test    al,08h
  80.     jnz     @@WaitNotVsync
  81. @@WaitVsync:
  82.     in      al,dx
  83.     test    al,08h
  84.     jz      @@WaitVsync
  85.     endm
  86.  
  87. ;-----------------------------------------------------------------------
  88. ; Macro to wait for the vertical retrace trailing edge
  89.  
  90. WaitVsyncEnd    macro
  91.     mov     dx,INPUT_STATUS_0
  92. @@WaitVsync2:
  93.     in      al,dx
  94.     test    al,08h
  95.     jz     @@WaitVsync2
  96. @@WaitNotVsync2:
  97.     in      al,dx
  98.     test    al,08h
  99.     jnz      @@WaitNotVsync2
  100.     endm
  101.  
  102. ;------------------------------------------------------------------------
  103. ; Global variables - XMAIN exports
  104. ;
  105.      global _InGraphics             :byte
  106.      global _CurrXMode              :word
  107.      global _ScrnPhysicalByteWidth  :word
  108.      global _ScrnPhysicalPixelWidth :word
  109.      global _ScrnPhysicalHeight     :word
  110.      global _ErrorValue             :byte
  111.  
  112.      global _SplitScrnOffs          :word
  113.      global _SplitScrnScanLine      :word
  114.      global _SplitScrnVisibleHeight :word
  115.      global _Page0_Offs             :word
  116.      global _Page1_Offs             :word
  117.      global _ScrnLogicalByteWidth   :word
  118.      global _ScrnLogicalPixelWidth  :word
  119.      global _ScrnLogicalHeight      :word
  120.  
  121.      global _MaxScrollX             :word
  122.      global _MaxScrollY             :word
  123.      global _DoubleBufferActive     :word
  124.      global _VisiblePageIdx         :word
  125.      global _VisiblePageOffs        :word
  126.      global _HiddenPageOffs         :word
  127.      global _NonVisual_Offs         :word